
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.1 新建话题 · Laravel学习-从零开发论坛系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="kaleozhou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2.html" />
    
    
    <link rel="prev" href="readme.html" />
    

    
        <link rel="shortcut icon" href='../book.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../book.ico' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../book.ico'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../book.ico">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../book.ico">
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.kaleozhou.top" target="_blank" class="custom-link">我的博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/1.html">
            
                <a href="../chapter1/1.html">
            
                    
                    第一章 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/readme.html">
            
                <a href="../chapter2/readme.html">
            
                    
                    第二章 创建应用及布局
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/1.html">
            
                <a href="../chapter2/1.html">
            
                    
                    2.1 创建应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/2.html">
            
                <a href="../chapter2/2.html">
            
                    
                    2.2 创建布局文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/3.html">
            
                <a href="../chapter2/3.html">
            
                    
                    2.3 创建首页展示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/4.html">
            
                <a href="../chapter2/4.html">
            
                    
                    2.4 调整样式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter3/readme.html">
            
                <a href="../chapter3/readme.html">
            
                    
                    第三章 laravel组件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter3/1.html">
            
                <a href="../chapter3/1.html">
            
                    
                    3.1 用户脚手架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter3/2.html">
            
                <a href="../chapter3/2.html">
            
                    
                    3.2 注册验证码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter3/3.html">
            
                <a href="../chapter3/3.html">
            
                    
                    3.3 邮箱验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../chapter3/4.html">
            
                <a href="../chapter3/4.html">
            
                    
                    3.4 密码重置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/readme.html">
            
                <a href="../chapter4/readme.html">
            
                    
                    第四章 基础功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/1.html">
            
                <a href="../chapter4/1.html">
            
                    
                    4.1 个人页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/2.html">
            
                <a href="../chapter4/2.html">
            
                    
                    4.2 编辑个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter4/3.html">
            
                <a href="../chapter4/3.html">
            
                    
                    4.3 显示个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter4/4.html">
            
                <a href="../chapter4/4.html">
            
                    
                    4.4 上传头像
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/readme.html">
            
                <a href="../chapter5/readme.html">
            
                    
                    第五章 帖子功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/1.html">
            
                <a href="../chapter5/1.html">
            
                    
                    5.1 帖子分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/2.html">
            
                <a href="../chapter5/2.html">
            
                    
                    5.2 代码生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter5/3.html">
            
                <a href="../chapter5/3.html">
            
                    
                    5.3 生成话题骨架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter5/4.html">
            
                <a href="../chapter5/4.html">
            
                    
                    5.4 假数据填充
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter5/5.html">
            
                <a href="../chapter5/5.html">
            
                    
                    5.5 话题列表页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter5/6.html">
            
                <a href="../chapter5/6.html">
            
                    
                    5.6 性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter5/7.html">
            
                <a href="../chapter5/7.html">
            
                    
                    5.7 分类下的话题列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter5/8.html">
            
                <a href="../chapter5/8.html">
            
                    
                    5.8 话题排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../chapter5/9.html">
            
                <a href="../chapter5/9.html">
            
                    
                    5.9 用户发布的话题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                    第六章 话题开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.7.1" data-path="1.html">
            
                <a href="1.html">
            
                    
                    6.1 新建话题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="2.html">
            
                <a href="2.html">
            
                    
                    6.2 编辑器优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="3.html">
            
                <a href="3.html">
            
                    
                    6.3 上传图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="4.html">
            
                <a href="4.html">
            
                    
                    6.4 显示帖子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="5.html">
            
                <a href="5.html">
            
                    
                    6.5 XSS安全漏洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="6.html">
            
                <a href="6.html">
            
                    
                    6.6 编辑帖子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >6.1 新建话题</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><b></b>6.1 &#x65B0;&#x5EFA;&#x8BDD;&#x9898;</a></li><ul><li><span class="title-icon "></span><a href="#&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><b></b>&#x65B0;&#x5EFA;&#x8BDD;&#x9898;</a></li><li><span class="title-icon "></span><a href="#&#x65B0;&#x589E;&#x5165;&#x53E3;"><b></b>&#x65B0;&#x589E;&#x5165;&#x53E3;</a></li><li><span class="title-icon "></span><a href="#&#x6570;&#x636E;&#x6A21;&#x578B;"><b></b>&#x6570;&#x636E;&#x6A21;&#x578B;</a></li><li><span class="title-icon "></span><a href="#&#x63A7;&#x5236;&#x5668;"><b></b>&#x63A7;&#x5236;&#x5668;</a></li><li><span class="title-icon "></span><a href="#&#x63D0;&#x4EA4;&#x8868;&#x5355;"><b></b>&#x63D0;&#x4EA4;&#x8868;&#x5355;</a></li><li><span class="title-icon "></span><a href="#&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;"><b></b>&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;</a></li><li><span class="title-icon "></span><a href="#&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;"><b></b>&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;</a></li><li><span class="title-icon "></span><a href="#&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;"><b></b>&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;</a></li></ul></ul></div><a href="#61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><a name="61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;" class="anchor-navigation-ex-anchor" href="#61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;" class="plugin-anchor" href="#61-&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>6.1 &#x65B0;&#x5EFA;&#x8BDD;&#x9898;</h1>
<h2 id="&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><a name="&#x65B0;&#x5EFA;&#x8BDD;&#x9898;" class="anchor-navigation-ex-anchor" href="#&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x65B0;&#x5EFA;&#x8BDD;&#x9898;" class="plugin-anchor" href="#&#x65B0;&#x5EFA;&#x8BDD;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x65B0;&#x5EFA;&#x8BDD;&#x9898;</h2>
<p>&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x5F00;&#x53D1;&#x5E16;&#x5B50;&#x53D1;&#x5E03;&#x529F;&#x80FD;&#xFF0C;&#x5141;&#x8BB8;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x53D1;&#x5E03;&#x5E16;&#x5B50;&#xFF0C;&#x53D1;&#x5E03;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x8DF3;&#x8F6C;&#x5230;&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;&#x9762;&#x3002;</p>
<h2 id="&#x65B0;&#x589E;&#x5165;&#x53E3;"><a name="&#x65B0;&#x589E;&#x5165;&#x53E3;" class="anchor-navigation-ex-anchor" href="#&#x65B0;&#x589E;&#x5165;&#x53E3;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x65B0;&#x589E;&#x5165;&#x53E3;" class="plugin-anchor" href="#&#x65B0;&#x589E;&#x5165;&#x53E3;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x65B0;&#x589E;&#x5165;&#x53E3;</h2>
<p>&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x4E3A;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x4E86;&#x65B0;&#x5EFA;&#x8BDD;&#x9898;&#x7684;&#x8DEF;&#x7531;Topics.create&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x5728;&#x53F3;&#x8FB9;&#x53F7;&#x822A;&#x680F;&#x548C;&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x680F;&#x65B0;&#x589E;&#x53D1;&#x8D34;&#x5165;&#x53E3;&#xFF1A;</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) vim resources/views/layouts/_header.blade.php
</code></pre><p>&#x5185;&#x5BB9;</p>
<pre><code>
.
.
.
&lt;!-- Authentication Links --&gt;
@guest
  &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&apos;login&apos;) }}&quot;&gt;&#x767B;&#x5F55;&lt;/a&gt;&lt;/li&gt;
  &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&apos;register&apos;) }}&quot;&gt;&#x6CE8;&#x518C;&lt;/a&gt;&lt;/li&gt;
@else
  &lt;li class=&quot;nav-item&quot;&gt;
    &lt;a class=&quot;nav-link mt-1 mr-3 font-weight-bold&quot; href=&quot;{{ route(&apos;topics.create&apos;) }}&quot;&gt;
      &lt;i class=&quot;fa fa-plus&quot;&gt;&lt;/i&gt;
    &lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&quot;nav-item dropdown&quot;&gt;
.
.
.
</code></pre><p>&#x4FEE;&#x6539;&#x4FA7;&#x8FB9;&#x680F;</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim resources/views/topics/_sidebar.blade.php
</code></pre><p>&#x5185;&#x5BB9;&#xFF1A;</p>
<pre><code>&lt;div class=&quot;card &quot;&gt;
  &lt;div class=&quot;card-body&quot;&gt;
       &lt;a href=&quot;{{ route(&apos;topics.create&apos;) }}&quot; class=&quot;btn btn-success btn-block&quot; aria-label=&quot;Left Align&quot;&gt;
      &lt;i class=&quot;fas fa-pencil-alt mr-2&quot;&gt;&lt;/i&gt;  &#x65B0;&#x5EFA;&#x5E16;&#x5B50;
    &lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre><p>&#x5237;&#x65B0;&#x9875;&#x9762;&#x67E5;&#x770B;&#x6548;&#x679C;&#xFF1A;
<img src="http://images.kaleozhou.top/6.1-01.png" alt="6.1-01.png"></p>
<h2 id="&#x6570;&#x636E;&#x6A21;&#x578B;"><a name="&#x6570;&#x636E;&#x6A21;&#x578B;" class="anchor-navigation-ex-anchor" href="#&#x6570;&#x636E;&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x6570;&#x636E;&#x6A21;&#x578B;" class="plugin-anchor" href="#&#x6570;&#x636E;&#x6A21;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6570;&#x636E;&#x6A21;&#x578B;</h2>
<p>&#x5F00;&#x59CB;&#x524D;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x51C6;&#x5907;&#x597D;&#x8BDD;&#x9898;&#x6570;&#x636E;&#x6A21;&#x578B;Topic&#x91CC;&#x7684;$fillable &#x5C5E;&#x6027;&#x3002;&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x5728;&#x751F;&#x6210;&#x6A21;&#x578B;&#x65F6;&#x5C06;&#x6240;&#x6709;&#x7684;&#x5B57;&#x6BB5;&#x90FD;&#x7F57;&#x5217;&#x51FA;&#x6765;&#xFF0C;&#x8FD9;&#x662F;&#x5F88;&#x5371;&#x9669;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;$fillable &#x5C5E;&#x6027;&#x5141;&#x8BB8;&#x7528;&#x6237;&#x76F4;&#x63A5;&#x5BF9;&#x6570;&#x636E;&#x5E93;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#xFF0C;&#x5728;&#x6BCF;&#x4E00;&#x6B21;&#x5F00;&#x53D1;&#x6570;&#x636E;&#x6A21;&#x578B;
&#x7684;crud&#x529F;&#x80FD;&#x662F;&#xFF0C;&#x6211;&#x4EEC;&#x90FD;&#x8981;&#x614E;&#x91CD;&#x5730;&#x5BF9;$fillable&#x5C5E;&#x6027;&#x8FDB;&#x884C;&#x5B9A;&#x5236;&#x3002;&#x7ED9;&#x81EA;&#x5DF1;&#x63D0;&#x4E00;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x3010;&#x90A3;&#x4E9B;&#x5B57;&#x6BB5;&#x6211;&#x4EEC;&#x4E0D;&#x5141;&#x8BB8;&#x7528;&#x6237;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#xFF1F;&#x3011;&#x3002;&#x5728;&#x6211;&#x4EEC;&#x5F53;&#x524D;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x4E00;&#x4E0B;&#x5B57;&#x6BB5;&#x7981;&#x6B62;&#x7528;&#x6237;&#x4FEE;&#x6539;&#xFF1A;</p>
<ul>
<li>user__id &#x2014;&#x2014;&#x6587;&#x7AE0;&#x7684;&#x4F5C;&#x8005;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x5E0C;&#x671B;&#x6587;&#x7AE0;&#x7684;&#x4F5C;&#x8005;&#x53EF;&#x4EE5;&#x88AB;&#x968F;&#x4FBF;&#x6307;&#x6D3E;&#xFF1B;</li>
<li>last_replay_user_id &#x2014;&#x2014; &#x6700;&#x540E;&#x56DE;&#x590D;&#x7684;&#x7528;&#x6237;ID&#xFF0C;&#x5C06;&#x7531;&#x7A0B;&#x5E8F;&#x6765;&#x7EF4;&#x62A4;&#xFF1B;</li>
<li>order &#x2014;&#x2014; &#x6587;&#x7AE0;&#x6392;&#x5E8F;&#xFF0C;&#x5C06;&#x4F1A;&#x662F;&#x7BA1;&#x7406;&#x5458;&#x4E13;&#x5C5E;&#x7684;&#x529F;&#x80FD;&#xFF1B;</li>
<li>replay__count &#x2014;&#x2014; &#x56DE;&#x590D;&#x6570;&#x91CF;&#xFF0C;&#x7A0B;&#x5E8F;&#x7EF4;&#x62A4;&#xFF1B;</li>
<li>view&#x2014;&#x2014;count &#x2014;&#x2014; &#x67E5;&#x770B;&#x6570;&#x91CF;&#xFF0C;&#x7A0B;&#x5E8F;&#x7EF4;&#x62A4;&#xFF1B;</li>
</ul>
<p>&#x6211;&#x4EEC;&#x628A;&#x4EE5;&#x4E0A;&#x5B57;&#x6BB5;&#x4ECE;Topic&#x6570;&#x636E;&#x6A21;&#x578B;&#x7684;$illable&#x5C5E;&#x6027;&#x4E2D;&#x79FB;&#x9664;&#xFF1A;</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Models/Topic.php
</code></pre><p>&#x5185;&#x5BB9;&#xFF1A;</p>
<pre><code> protected $fillable = [&apos;title&apos;, &apos;body&apos;, &apos;category_id&apos;, &apos;reply_count&apos;,&apos;excerpt&apos;, &apos;slug&apos;];
</code></pre><h2 id="&#x63A7;&#x5236;&#x5668;"><a name="&#x63A7;&#x5236;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x63A7;&#x5236;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x63A7;&#x5236;&#x5668;" class="plugin-anchor" href="#&#x63A7;&#x5236;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x63A7;&#x5236;&#x5668;</h2>
<p>&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x5DF2;&#x7ECF;&#x5E2E;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x4E86;&#x8DEF;&#x7531;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x5141;&#x8BB8;&#x7528;&#x6237;&#x5728;&#x53D1;&#x5E16;&#x5B50;&#x7684;&#x65F6;&#x5019;&#x9009;&#x62E9;&#x5206;&#x7C7B;&#xFF0C;&#x56E0;&#x6B64;&#x6211;&#x4EEC;&#x63A5;&#x4E0B;&#x6765;&#x4FEE;&#x6539;&#x63A7;&#x5236;&#x5668;&#x7684;create()&#x65B9;&#x6CD5;&#xFF0C;&#x5C06;&#x6240;&#x6709;&#x7684;&#x5206;&#x7C7B;&#x8BFB;&#x53D6;&#x8D4B;&#x503C;&#x7ED9;&#x53D8;&#x91CF;&amp;categories,&#x5E76;&#x4F20;&#x5165;&#x6A21;&#x677F;&#x4E2D;&#xFF1A;</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/TopicsController.php
</code></pre><p>&#x5185;&#x5BB9;:</p>
<pre><code>use App\Models\Category;
.
.
.

public function create(Topic $topic)
{
    $categories=Category::all();
    return view(&apos;topics.create_and_edit&apos;, compact(&apos;topic&apos;,&apos;categories&apos;));
}
.
.
.
</code></pre><p>&#x63A5;&#x4E0B;&#x6765;&#x4FEE;&#x6539;&#x6A21;&#x677F;:</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim resources/views/topics/create_and_edit.blade.php
</code></pre><p>&#x5185;&#x5BB9;:</p>
<pre><code>
@extends(&apos;layouts.app&apos;)

@section(&apos;content&apos;)

  &lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;col-md-10 offset-md-1&quot;&gt;
      &lt;div class=&quot;card &quot;&gt;

        &lt;div class=&quot;card-body&quot;&gt;
          &lt;h2 class=&quot;&quot;&gt;
            &lt;i class=&quot;far fa-edit&quot;&gt;&lt;/i&gt;
            @if($topic-&gt;id)
            &#x7F16;&#x8F91;&#x8BDD;&#x9898;
            @else
            &#x65B0;&#x5EFA;&#x8BDD;&#x9898;
            @endif
          &lt;/h2&gt;

          &lt;hr&gt;

          @if($topic-&gt;id)
            &lt;form action=&quot;{{ route(&apos;topics.update&apos;, $topic-&gt;id) }}&quot; method=&quot;POST&quot; accept-charset=&quot;UTF-8&quot;&gt;
              &lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;PUT&quot;&gt;
          @else
            &lt;form action=&quot;{{ route(&apos;topics.store&apos;) }}&quot; method=&quot;POST&quot; accept-charset=&quot;UTF-8&quot;&gt;
          @endif

              &lt;input type=&quot;hidden&quot; name=&quot;_token&quot; value=&quot;{{ csrf_token() }}&quot;&gt;

              @include(&apos;shared._error&apos;)

              &lt;div class=&quot;form-group&quot;&gt;
                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;title&quot; value=&quot;{{ old(&apos;title&apos;, $topic-&gt;title ) }}&quot; placeholder=&quot;&#x8BF7;&#x586B;&#x5199;&#x6807;&#x9898;&quot; required /&gt;
              &lt;/div&gt;

              &lt;div class=&quot;form-group&quot;&gt;
                &lt;select class=&quot;form-control&quot; name=&quot;category_id&quot; required&gt;
                  &lt;option value=&quot;&quot; hidden disabled selected&gt;&#x8BF7;&#x9009;&#x62E9;&#x5206;&#x7C7B;&lt;/option&gt;
                  @foreach ($categories as $value)
                  &lt;option value=&quot;{{ $value-&gt;id }}&quot;&gt;{{ $value-&gt;name }}&lt;/option&gt;
                  @endforeach
                &lt;/select&gt;
              &lt;/div&gt;

              &lt;div class=&quot;form-group&quot;&gt;
                &lt;textarea name=&quot;body&quot; class=&quot;form-control&quot; id=&quot;editor&quot; rows=&quot;6&quot; placeholder=&quot;&#x8BF7;&#x586B;&#x5165;&#x81F3;&#x5C11;&#x4E09;&#x4E2A;&#x5B57;&#x7B26;&#x7684;&#x5185;&#x5BB9;&#x3002;&quot; required&gt;{{ old(&apos;body&apos;, $topic-&gt;body ) }}&lt;/textarea&gt;
              &lt;/div&gt;

              &lt;div class=&quot;well well-sm&quot;&gt;
                &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;&lt;i class=&quot;far fa-save mr-2&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt; &#x4FDD;&#x5B58;&lt;/button&gt;
              &lt;/div&gt;
            &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

@endsection
</code></pre><p>&#x5237;&#x65B0;&#x9875;&#x9762;:
<img src="http://images.kaleozhou.top/6.1-02.png" alt="6.1-02.png"></p>
<h2 id="&#x63D0;&#x4EA4;&#x8868;&#x5355;"><a name="&#x63D0;&#x4EA4;&#x8868;&#x5355;" class="anchor-navigation-ex-anchor" href="#&#x63D0;&#x4EA4;&#x8868;&#x5355;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x63D0;&#x4EA4;&#x8868;&#x5355;" class="plugin-anchor" href="#&#x63D0;&#x4EA4;&#x8868;&#x5355;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x63D0;&#x4EA4;&#x8868;&#x5355;</h2>
<p>&#x6D4B;&#x8BD5;&#x5982;&#x4E0B;
<img src="http://images.kaleozhou.top/6.1-03.png" alt="6.1-03.png">
&#x6CA1;&#x6709;&#x6307;&#x5B9A;user_id&#x5B57;&#x6BB5;&#x7684;&#x503C;&#x3002;&#x4FEE;&#x6539;&#x63A7;&#x5236;&#x5668;&#x628A;&#x767B;&#x5F55;&#x7528;&#x6237;&#x7684;ID&#x8D4B;&#x503C;&#x7ED9;User_id:</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/TopicsController.php
</code></pre><p>&#x5185;&#x5BB9;:</p>
<pre><code>&lt;?php

namespace App\Http\Controllers;

use App\Models\Topic;
use App\Models\Category;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\TopicRequest;
use Auth;

class TopicsController extends Controller
{
    public function __construct()
    {
        $this-&gt;middleware(&apos;auth&apos;, [&apos;except&apos; =&gt; [&apos;index&apos;, &apos;show&apos;]]);
    }

    public function index(Request $request,Topic $topic)
    {
        $topics = $topic-&gt;withOrder($request-&gt;order)-&gt;paginate();
        return view(&apos;topics.index&apos;, compact(&apos;topics&apos;));
    }

    public function show(Topic $topic)
    {
        return view(&apos;topics.show&apos;, compact(&apos;topic&apos;));
    }

    public function create(Topic $topic)
    {
        $categories=Category::all();
        return view(&apos;topics.create_and_edit&apos;, compact(&apos;topic&apos;,&apos;categories&apos;));
    }

    public function store(TopicRequest $request,Topic $topic)
    {
        $topic-&gt;fill($request-&gt;all());
        $topic-&gt;user_id=Auth::id();
        $topic-&gt;save();
        return redirect()-&gt;route(&apos;topics.show&apos;, $topic-&gt;id)-&gt;with(&apos;success&apos;, &apos;&#x5E16;&#x5B50;&#x521B;&#x5EFA;&#x6210;&#x529F;!&apos;);
    }

    public function edit(Topic $topic)
    {
        $this-&gt;authorize(&apos;update&apos;, $topic);
        return view(&apos;topics.create_and_edit&apos;, compact(&apos;topic&apos;));
    }

    public function update(TopicRequest $request, Topic $topic)
    {
        $this-&gt;authorize(&apos;update&apos;, $topic);
        $topic-&gt;update($request-&gt;all());

        return redirect()-&gt;route(&apos;topics.show&apos;, $topic-&gt;id)-&gt;with(&apos;message&apos;, &apos;Updated successfully.&apos;);
    }

    public function destroy(Topic $topic)
    {
        $this-&gt;authorize(&apos;destroy&apos;, $topic);
        $topic-&gt;delete();

        return redirect()-&gt;route(&apos;topics.index&apos;)-&gt;with(&apos;message&apos;, &apos;Deleted successfully.&apos;);
    }
}
</code></pre><p>&#x518D;&#x6B21;&#x63D0;&#x4EA4;&#x6548;&#x679C;:
<img src="http://images.kaleozhou.top/6.1-04.png" alt="6.1-04.png"></p>
<h2 id="&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;"><a name="&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;" class="plugin-anchor" href="#&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6A21;&#x578B;&#x89C2;&#x5BDF;&#x5668;</h2>
<p>excerpt &#x5B57;&#x6BB5;&#x5B58;&#x50A8;&#x7684;&#x662F;&#x8BDD;&#x9898;&#x7684;&#x6458;&#x5F55;&#xFF0C;&#x5C06;&#x4F5C;&#x4E3A;&#x6587;&#x7AE0;&#x9875;&#x9762;&#x7684; description &#x5143;&#x6807;&#x7B7E;&#x4F7F;&#x7528;&#xFF0C;&#x6709;&#x5229;&#x4E8E; SEO &#x641C;&#x7D22;&#x5F15;&#x64CE;&#x4F18;&#x5316;&#x3002;&#x6458;&#x5F55;&#x7531;&#x6587;&#x7AE0;&#x5185;&#x5BB9;&#x4E2D;&#x81EA;&#x52A8;&#x751F;&#x6210;&#xFF0C;&#x751F;&#x6210;&#x7684;&#x65F6;&#x673A;&#x662F;&#x5728;&#x8BDD;&#x9898;&#x6570;&#x636E;&#x5B58;&#x5165;&#x6570;&#x636E;&#x5E93;&#x4E4B;&#x524D;&#x3002;&#x6211;&#x4EEC;&#x5C06;&#x4F7F;&#x7528; Eloquent &#x7684; &#x89C2;&#x5BDF;&#x5668; &#x6765;&#x5B9E;&#x73B0;&#x6B64;&#x529F;&#x80FD;&#x3002;</p>
<p>Eloquent &#x6A21;&#x578B;&#x4F1A;&#x89E6;&#x53D1;&#x8BB8;&#x591A;&#x4E8B;&#x4EF6;&#xFF08;Event&#xFF09;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5BF9;&#x6A21;&#x578B;&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x5185;&#x591A;&#x4E2A;&#x65F6;&#x95F4;&#x70B9;&#x8FDB;&#x884C;&#x76D1;&#x63A7;&#xFF1A; creating, created, updating, updated, saving, saved, deleting, deleted, restoring, restored&#x3002;&#x4E8B;&#x4EF6;&#x8BA9;&#x4F60;&#x6BCF;&#x5F53;&#x6709;&#x7279;&#x5B9A;&#x7684;&#x6A21;&#x578B;&#x7C7B;&#x5728;&#x6570;&#x636E;&#x5E93;&#x4FDD;&#x5B58;&#x6216;&#x66F4;&#x65B0;&#x65F6;&#xFF0C;&#x6267;&#x884C;&#x4EE3;&#x7801;&#x3002;&#x5F53;&#x4E00;&#x4E2A;&#x65B0;&#x6A21;&#x578B;&#x88AB;&#x521D;&#x6B21;&#x4FDD;&#x5B58;&#x5C06;&#x4F1A;&#x89E6;&#x53D1; creating &#x4EE5;&#x53CA; created &#x4E8B;&#x4EF6;&#x3002;&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x6A21;&#x578B;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x4E8E;&#x6570;&#x636E;&#x5E93;&#x4E14;&#x8C03;&#x7528;&#x4E86; save &#x65B9;&#x6CD5;&#xFF0C;&#x5C06;&#x4F1A;&#x89E6;&#x53D1; updating &#x548C; updated &#x4E8B;&#x4EF6;&#x3002;&#x5728;&#x8FD9;&#x4E24;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#x90FD;&#x4F1A;&#x89E6;&#x53D1; saving &#x548C; saved &#x4E8B;&#x4EF6;&#x3002;
Eloquent &#x89C2;&#x5BDF;&#x5668;&#x5141;&#x8BB8;&#x6211;&#x4EEC;&#x5BF9;&#x7ED9;&#x5B9A;&#x6A21;&#x578B;&#x4E2D;&#x8FDB;&#x884C;&#x4E8B;&#x4EF6;&#x76D1;&#x63A7;&#xFF0C;&#x89C2;&#x5BDF;&#x8005;&#x7C7B;&#x91CC;&#x7684;&#x65B9;&#x6CD5;&#x540D;&#x5BF9;&#x5E94; Eloquent &#x60F3;&#x76D1;&#x542C;&#x7684;&#x4E8B;&#x4EF6;&#x3002;&#x6BCF;&#x79CD;&#x65B9;&#x6CD5;&#x63A5;&#x6536; model &#x4F5C;&#x4E3A;&#x5176;&#x552F;&#x4E00;&#x7684;&#x53C2;&#x6570;&#x3002;&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x5DF2;&#x7ECF;&#x4E3A;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x4E86;&#x4E00;&#x4E2A;&#x89C2;&#x5BDF;&#x5668;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x5728; AppServiceProvider &#x4E2D;&#x6CE8;&#x518C;&#x3002;&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x8981;&#x5B9A;&#x5236;&#x6B64;&#x89C2;&#x5BDF;&#x5668;&#xFF0C;&#x5728; Topic &#x6A21;&#x578B;&#x4FDD;&#x5B58;&#x65F6;&#x89E6;&#x53D1;&#x7684; saving &#x4E8B;&#x4EF6;&#x4E2D;&#xFF0C;&#x5BF9; excerpt &#x5B57;&#x6BB5;&#x8FDB;&#x884C;&#x8D4B;&#x503C;:</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Observers/TopicObserver.php
</code></pre><p>&#x5185;&#x5BB9;</p>
<pre><code>&lt;?php

namespace App\Observers;

use App\Models\Topic;

// creating, created, updating, updated, saving,
// saved,  deleting, deleted, restoring, restored

class TopicObserver
{
    public function creating(Topic $topic)
    {
        //
    }

    public function updating(Topic $topic)
    {
        //
    }
    public function saving(Topic $topic)
    {
        $topic-&gt;excerpt = make_excerpt($topic-&gt;body);
    }
}
</code></pre><p>make_excerpt()&#x662F;&#x6211;&#x4EEC;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x8F85;&#x52A9;&#x65B9;&#x6CD5;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x5728;helpers.php&#x6587;&#x4EF6;&#x4E2D;&#x6DFB;&#x52A0;:</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/helpers.php
</code></pre><p>&#x5185;&#x5BB9;:</p>
<pre><code>function make_excerpt($value, $length = 200)
{
    $excerpt = trim(preg_replace(&apos;/\r\n|\r|\n+/&apos;, &apos; &apos;, strip_tags($value)));
    return str_limit($excerpt, $length);
}
</code></pre><h2 id="&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;"><a name="&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;" class="anchor-navigation-ex-anchor" href="#&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;" class="plugin-anchor" href="#&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;</h2>
<p>&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x5904;&#x7406;&#x4E0B;&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x89C4;&#x5219;&#xFF0C;&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x5DF2;&#x7ECF;&#x4E3A;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x4E86;TopicRequest&#x8868;&#x5355;&#x9A8C;&#x8BC1;&#x7C7B;&#xFF0C;&#x5E76;&#x4E14;&#x81EA;&#x52A8;&#x5728;&#x63A7;&#x5236;&#x5668;&#x65B9;&#x6CD5;&#x4E2D;&#x6CE8;&#x5165;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x9700;&#x8981;&#x4FEE;&#x6539;:</p>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Http/Requests/TopicRequest.php
</code></pre><p>&#x4FEE;&#x6539;:</p>
<pre><code>&lt;?php

namespace App\Http\Requests;

class TopicRequest extends Request
{
    public function rules()
    {
        switch($this-&gt;method())
        {
            // CREATE
            case &apos;POST&apos;:
            // UPDATE
            case &apos;PUT&apos;:
            case &apos;PATCH&apos;:
            {
                return [
                    &apos;title&apos;       =&gt; &apos;required|min:2&apos;,
                    &apos;body&apos;        =&gt; &apos;required|min:3&apos;,
                    &apos;category_id&apos; =&gt; &apos;required|numeric&apos;,
                ];
            }
            case &apos;GET&apos;:
            case &apos;DELETE&apos;:
            default:
            {
                return [];
            };
        }
    }

    public function messages()
    {
        return [
            &apos;title.min&apos; =&gt; &apos;&#x6807;&#x9898;&#x5FC5;&#x987B;&#x81F3;&#x5C11;&#x4E24;&#x4E2A;&#x5B57;&#x7B26;&apos;,
            &apos;body.min&apos; =&gt; &apos;&#x6587;&#x7AE0;&#x5185;&#x5BB9;&#x5FC5;&#x987B;&#x81F3;&#x5C11;&#x4E09;&#x4E2A;&#x5B57;&#x7B26;&apos;,
        ];
    }
}
</code></pre><p>&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;:
<img src="http://images.kaleozhou.top/6.1-05.png" alt="6.1-05.png"></p>
<h2 id="&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;"><a name="&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;" class="anchor-navigation-ex-anchor" href="#&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;" class="plugin-anchor" href="#&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x65B0;&#x5EFA;&#x5E16;&#x5B50;&#x6743;&#x9650;</h2>
<pre><code>&#x279C; kaleo@zhou  ~/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/TopicsController.php
</code></pre><p>&#x5185;&#x5BB9;</p>
<pre><code>.
.
.

    public function __construct()
    {
        $this-&gt;middleware(&apos;auth&apos;, [&apos;except&apos; =&gt; [&apos;index&apos;, &apos;show&apos;]]);
    }
.
.
.
</code></pre><p>&#x51FA;&#x4E86;index()&#x548C;show()&#x4EE5;&#x5916;&#x7684;&#x65B9;&#x6CD5;&#x4F7F;&#x7528;auth()&#x4E2D;&#x95F4;&#x4EF6;&#x8FDB;&#x884C;&#x8BA4;&#x8BC1;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; kaleozhou 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-05-20 17:24:42
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="readme.html" class="navigation navigation-prev " aria-label="Previous page: 第六章 话题开发">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2.html" class="navigation navigation-next " aria-label="Next page: 6.2 编辑器优化">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.1 新建话题","level":"1.7.1","depth":2,"next":{"title":"6.2 编辑器优化","level":"1.7.2","depth":2,"path":"chapter6/2.md","ref":"chapter6/2.md","articles":[]},"previous":{"title":"第六章 话题开发","level":"1.7","depth":1,"path":"chapter6/readme.md","ref":"chapter6/readme.md","articles":[{"title":"6.1 新建话题","level":"1.7.1","depth":2,"path":"chapter6/1.md","ref":"chapter6/1.md","articles":[]},{"title":"6.2 编辑器优化","level":"1.7.2","depth":2,"path":"chapter6/2.md","ref":"chapter6/2.md","articles":[]},{"title":"6.3 上传图片","level":"1.7.3","depth":2,"path":"chapter6/3.md","ref":"chapter6/3.md","articles":[]},{"title":"6.4 显示帖子","level":"1.7.4","depth":2,"path":"chapter6/4.md","ref":"chapter6/4.md","articles":[]},{"title":"6.5 XSS安全漏洞","level":"1.7.5","depth":2,"path":"chapter6/5.md","ref":"chapter6/5.md","articles":[]},{"title":"6.6 编辑帖子","level":"1.7.6","depth":2,"path":"chapter6/6.md","ref":"chapter6/6.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","donate","sharing-plus","anchor-navigation-ex","tbfed-pagefooter","favicon"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy kaleozhou 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/kaleozhou"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"donate":{"alipay":"http://images.kaleozhou.top/zanshang.png","alipayText":" ","button":"赞赏","title":"","wechat":"","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./book.ico","bookmark":"./book.ico","appleTouch":"./book.ico","appleTouchMore":{"120x120":"./book.ico","180x180":"./book.ico"}},"github-buttons":{"buttons":[{"user":"kaleozhou","repo":"guanwang","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":true,"all":["weibo","qq","qzone"],"douban":true,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","author":"kaleozhou","pdf":{"pageBreaksBefore":"/","paperSize":"a4","margin":{"right":30,"left":30,"top":30,"bottom":50},"fontSize":18,"pageSize":"a4","fontFamily":"Arial","doc":true,"chapterMark":"pagebreak","pageNumbers":true},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Laravel学习-从零开发论坛系统","language":"zh-hans","links":{"sidebar":{"我的博客":"http://www.kaleozhou.top"}},"gitbook":"3.2.3","description":"laravel框架开发论坛系统"},"file":{"path":"chapter6/1.md","mtime":"2019-05-20T09:24:42.095Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-25T02:56:39.861Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

